## mako

## This navigation has been deprecated in favor of the responsive header found in header/header.html
## To use this new header, change the include statement in your templates/header.html file to import
## the header/header.html file as opposed to the navigation/navigation.html file.

<%page expression_filter="h" args="online_help_token"/>

<%namespace name='static' file='../static_content.html'/>
<%namespace file='../main.html' import="login_query"/>
<%!
from django.urls import reverse
from django.utils.translation import gettext as _

from lms.djangoapps.ccx.overrides import get_current_ccx
from openedx.core.djangolib.markup import HTML, Text

# App that handles subdomain specific branding
from lms.djangoapps.branding import api as branding_api
from openedx.core.djangoapps.lang_pref.api import header_language_selector_is_enabled, released_languages
%>

<script type="text/javascript" src="${static.url('js/header/header.js')}"></script>

## Provide a hook for themes to inject branding on top.
<%block name="navigation_top" />

% if uses_bootstrap:
  <header class="navigation-container header-global ${'slim' if course else ''}">
    <nav class="navbar navbar-expand-lg">
      <%include file="bootstrap/navbar-logo-header.html" args="online_help_token=online_help_token"/>
      <button class="navbar-toggler navbar-toggler-right mt-2" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      % if user.is_authenticated:
        <%include file="navbar-authenticated.html" args="online_help_token=online_help_token"/>
      % else:
        <%include file="navbar-not-authenticated.html" args="online_help_token=online_help_token"/>
      % endif
    </nav>
  </header>
% else:
  <header id="global-navigation" class="header-global ${"slim" if course else ""}" >
    <nav class="wrapper-header" aria-label="${_('Global')}">
      <%include file="navbar-logo-header.html" args="online_help_token=online_help_token"/>
      % if user.is_authenticated:
        <%include file="navbar-authenticated.html" args="online_help_token=online_help_token"/>
      % else:
        <%include file="navbar-not-authenticated.html" args="online_help_token=online_help_token"/>
      % endif
      % if header_language_selector_is_enabled():
        <% languages = released_languages() %>
        % if len(languages) > 1:
          <ol class="user">
            <li class="primary">
              <form action="/i18n/setlang/" method="post" class="settings-language-form" id="language-settings-form">
                <input type="hidden" id="csrf_token" name="csrfmiddlewaretoken" value="${csrf_token}">
                % if user.is_authenticated:
                  <input title="preference api" type="hidden" class="url-endpoint" value="${reverse('preferences_api', kwargs={'username': user.username})}" data-user-is-authenticated="true">
                % else:
                  <input title="session update url" type="hidden" class="url-endpoint" value="${reverse('update_language')}" data-user-is-authenticated="false">
                % endif
                <label><span class="sr">${_("Choose Language")}</span>
                  <select class="input select language-selector" id="settings-language-value" name="language">
                    % for language in languages:
                      % if language[0] == LANGUAGE_CODE:
                        <option value="${language[0]}" selected="selected">${language[1]}</option>
                      % else:
                        <option value="${language[0]}" >${language[1]}</option>
                      % endif
                    % endfor
                  </select>
                </label>
              </form>
            </li>
          </ol>
        % endif
      % endif
    </nav>
  </header>
% endif
% if course:
<!--[if lte IE 9]>
<div class="ie-banner" aria-hidden="true">${Text(_('{begin_strong}Warning:{end_strong} Your browser is not fully supported. We strongly recommend using {chrome_link} or {ff_link}.')).format(
    begin_strong=HTML('<strong>'),
    end_strong=HTML('</strong>'),
    chrome_link=HTML('<a href="https://www.google.com/chrome" rel="noopener" target="_blank">Chrome</a>'),
    ff_link=HTML('<a href="http://www.mozilla.org/firefox" rel="noopener" target="_blank">Firefox</a>'),
)}</div>
<![endif]-->
% endif

% if settings.FEATURES.get('ENABLE_COOKIE_CONSENT', False):
  <%include file="../widgets/cookie-consent.html" />
% endif
